//
//  AyWeiboTool.m
//  xWeibo
//
//  Created by alvis mac on 8/6/15.
//  Copyright (c) 2015 alvis. All rights reserved.
//

#import "AyWeiboTool.h"
#import "AyTableBarController.h"
#import "AyfeatureController.h"
#import <UIKit/UIKit.h>
@implementation AyWeiboTool
+ (void)chooseRootController{
    
   NSString *key = @"CFBundleVersion";
    NSUserDefaults *defalut=[NSUserDefaults standardUserDefaults];
    NSString *lastVersion=[defalut stringForKey:key];
    
    NSString *currentVersion=[NSBundle mainBundle].infoDictionary[key];
    UIApplication *currentApption=[UIApplication sharedApplication];
    if([currentVersion isEqualToString:lastVersion]){
        currentApption.statusBarHidden=NO;
        currentApption.keyWindow.rootViewController=[[AyTableBarController alloc] init];
    }else{
        currentApption.keyWindow.rootViewController=[[AyfeatureController alloc] init];
        [defalut setObject:currentVersion forKey:key];
        [defalut synchronize];
    }
    

}
@end
